package com.walming.generator.support.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.walming.generator.copycat.annotaion.Eq;
import com.walming.generator.copycat.annotaion.Time;
import com.walming.generator.copycat.enums.CompareEnum;
import com.walming.generator.copycat.enums.TimeQueryFormat;
import com.walming.generator.copycat.extend.AbstractQuery;
import com.walming.generator.support.domain.GenTemplate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 代码生成模板查询条件
 *
 * @author jianxiao
 * @date 2020/12/18 13:38
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "GenTemplateQuery", description = "GenTemplateQuery代码生成模板查询条件")
public class GenTemplateQuery extends AbstractQuery<GenTemplate> {

    @Eq
    @ApiModelProperty("模板类型")
    private String templateType;

    @Eq
    @ApiModelProperty("模板名称")
    private String templateName;

    @Eq
    @ApiModelProperty("启用状态")
    private Long status;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Time(alias = "create_time", compare = CompareEnum.GE, format = TimeQueryFormat.DAY_BEGIN)
    @ApiModelProperty(value = "开始时间段", position = 10)
    private Date beginTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Time(alias = "create_time", compare = CompareEnum.LE, format = TimeQueryFormat.DAY_END)
    @ApiModelProperty(value = "结束时间段", position = 11)
    private Date endTime;

}
